]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Unrestrict PickColor
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 25 Sep 2021 12:15:32 +0000 (14:15 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 6 Oct 2021 17:34:18 +0000 (17:34 +0000)
Commit dd2cd6286cd3 restricted callers of the screenshot methods to
portal implementations, gnome-settings-daemon and gnome-screenshot.

That restriction does make sense for the actual screenshot methods,
but `PickColor` is actually used by GTK in its color picker (and
therefore may be called from arbitrary applications).

Fix this by unrestricting access to `PickColor` again. Considering that
the method is always interactive, it's not very privacy/security-sensitive
anyway.

https://gitlab.gnome.org/GNOME/gtk/-/issues/4283

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1990>

js/ui/screenshot.js

index bf537b7d6d083326d3f8cce2449a57821c20cc73..ae1156f477681c04869ecd03bfa046b9caa3c18e 100644 (file)
@@ -37,7 +37,7 @@ var ScreenshotService = class {
         Gio.DBus.session.own_name('org.gnome.Shell.Screenshot', Gio.BusNameOwnerFlags.REPLACE, null, null);
     }
 
-    _createScreenshot(invocation, needsDisk = true) {
+    _createScreenshot(invocation, needsDisk = true, restrictCallers = true) {
         let lockedDown = false;
         if (needsDisk)
             lockedDown = this._lockdownSettings.get_boolean('disable-save-to-disk');
@@ -53,7 +53,7 @@ var ScreenshotService = class {
                 Gio.IOErrorEnum, Gio.IOErrorEnum.PERMISSION_DENIED,
                 'Saving to disk is disabled');
             return null;
-        } else {
+        } else if (restrictCallers) {
             try {
                 this._senderChecker.checkInvocation(invocation);
             } catch (e) {
@@ -311,7 +311,7 @@ var ScreenshotService = class {
     }
 
     async PickColorAsync(params, invocation) {
-        const screenshot = this._createScreenshot(invocation, false);
+        const screenshot = this._createScreenshot(invocation, false, false);
         if (!screenshot)
             return;